<!--
 * 语音交互界面
 * @Author: John Trump
 * @Date: 2020-07-15 16:46:53
 * @LastEditors: John Trump
 * @LastEditTime: 2020-07-15 17:42:34
 * @FilePath: /src/views/ask/index.vue
-->

<template>
  <div>
    <Robot></Robot>
    <div class="card">
      <div class="left">
        <img src="http://lorempixel.com/640/480/nature" />
        <div class="name">米饭</div>
      </div>
      <div class="right">
        <div class="name">
          份数：
          <span class="count-wrapper">
            <i class="reduce" @click="count--"></i>
            <span class="count">{{ count }}份</span>
            <i class="add" @click="count++"> </i>
          </span>
        </div>
        <div class="name">蛋白质：<span class="grey">233克</span></div>
        <div class="name">脂肪：<span class="grey">233克</span></div>
        <div class="name">碳水：<span class="grey">233克</span></div>
        <div class="name">
          其他营养物质：<span class="unfold" @click="handleFold">展开></span>
        </div>
        <div class="catogories">
          <div class="catogory">
            时间：<span class="grey">今早</span>
            <span class="edit" @click="handleEdit">修改</span>
          </div>
          <div class="catogory">
            餐别：<span class="grey">早餐</span>
            <span class="edit" @click="handleEdit">修改</span>
          </div>
        </div>
      </div>
    </div>
    <div class="tips">
      提示：如果我<span class="error">识别错了</span>请重新说
      <span class="command">“大林大林，我今天吃了...”</span>
      <i @click="handleInfo">i</i>
    </div>
  </div>
</template>

<script>
import Robot from "../../components/Robot";

export default {
  name: "AskView",
  data() {
    return {
      count: 1
    };
  },
  methods: {
    /** 点击Info */
    handleInfo() {
      console.log("handleInfo");
    },
    /** 展开描述 */
    handleFold() {
      console.log("handleFold");
    },
    /** 处理点击修改 */
    handleEdit() {
      console.log("handleEdit");
    }
  },
  components: {
    Robot
  }
};
</script>

<style lang="less" scoped>
.card {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  top: 40px;
  margin: 0 auto;
  width: 1840px;
  height: 664px;
  background: rgba(255, 255, 255, 1);
  box-shadow: 0px 2px 30px 0px rgba(18, 70, 53, 0.08);
  border-radius: 50px;
  padding: 60px;
  .name {
    font-size: 50px;
    font-weight: bold;
    color: #000;
    line-height: 60+24px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    .grey {
      color: #c3cfcb;
    }
    .unfold {
      color: #33cb98;
      text-decoration: underline;
      &:active {
        opacity: 0.8;
      }
    }
    .count-wrapper {
      color: #33cb98;
      display: flex;
      align-items: center;
      .count {
        margin: 0 40px;
        text-align: center;
      }
      .add {
        display: inline-block;
        width: 54px;
        height: 54px;
        background-image: url("../../assets/images/icon-add.png");
        background-size: contain;
      }
      .reduce {
        display: inline-block;
        width: 54px;
        height: 54px;
        background-image: url("../../assets/images/icon-reduce.png");
        background-size: contain;
      }
    }
  }
  .left {
    img {
      width: 680px;
      height: 510px;
      border-radius: 40px;
      background-color: #efefef;
    }
    .name {
      justify-content: center;
    }
  }
  .right {
    margin-left: 60px;
    width: 100%;
  }

  .catogories {
    position: relative;
    top: 76px;
    display: flex;
    // justify-content: space-around;
    font-size: 40px;
    color: #000;
    font-weight: bold;
    width: 100%;
    .catogory {
      display: flex;
      align-items: center;
      margin-right: 60px;
    }
    .grey {
      color: #c3cfcb;
      margin: 0 40px;
    }
    .edit {
      color: #33cb98;
      font-size: 34px;
      text-decoration: underline;
      &:active {
        opacity: .7;
      }
    }
  }
}

/* 提示 */
.tips {
  position: relative;
  top: 64px;
  font-size: 60px;
  font-weight: bold;
  color: #000;
  .command {
    color: #33cb98;
  }
  .error {
    color: #f36271;
  }
  i {
    margin-left: 60px;
    display: inline-block;
    box-sizing: border-box;
    width: 70px;
    height: 70px;
    line-height: 70px;
    color: #ffffff;
    background: #33cb98;
    border-radius: 100%;
    &:active {
      opacity: 0.7;
    }
  }
}
</style>
